package com.itWaiLong.Controller.Learning;

import com.itWaiLong.Result.Result;
import com.itWaiLong.Service.LearningService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/learning/delete")
public class DeleteLearningController {

    @Autowired
    private LearningService learningService;

    /**
     * 通过资料id删除资料
     * @param resourceId
     * @return
     */
    @GetMapping
    public Result delete(@RequestParam int resourceId){
        log.info("资料的id：{}",resourceId);

        learningService.delete(resourceId);
        return Result.success();
    }
}
